0
Welcome Guest! Login
0 items Join Now

Adding a custom font that shows in the backend

    • Damir's Avatar
    • Damir
    • Preeminent Rocketeer
    • Posts: 22450
    • Thanks: 2679
    • Web Developer

    Re: Adding a custom font that shows in the backend

    Posted 4 years 6 months ago
    • Please post your URL, Username and Password in Secure Tab and i will take a look and maybe figure out what the problem is.

      FTP info with Username and password is also necessary ...

      For posting sensitive information you hit the Blue Reply Button and then you will see Secure Tab. Post all info that is sensitive in there, only Fellow Mods, Staff and I can see that!
    • Available for CUSTOM WORK with Joomla, WordPress and Grav Templates and Gantry Framework!
    • Eoin's Avatar
    • Eoin
    • Hero Rocketeer
    • Posts: 413
    • Thanks: 17

    Re: Adding a custom font that shows in the backend

    Posted 4 years 6 months ago
    • Thanks Damir, I really appreciate your time.

      Please could you let me know what the issue is when you find it? That way I can reenact this in the future without needing your help.

      Thanks again
    • Just a lonely web designer trying to make his way
  • Re: Adding a custom font that shows in the backend

    Posted 4 years 6 months ago
    • I've edited your theme.yaml file (the one that is not in custom) and now the font appears as an option. Unfortunately, the theme.yaml file cannot be used in the custom/ folder and therefore will be overwritten in the event of a template update.
    • Last Edit: 4 years 6 months ago by Reggie Simmons.
    • The following users have thanked you: Eoin

    • Kind regards,
      Reggie

      Learn to code for free.
      www.freecodecamp.org
    • Damir's Avatar
    • Damir
    • Preeminent Rocketeer
    • Posts: 22450
    • Thanks: 2679
    • Web Developer

    Re: Adding a custom font that shows in the backend

    Posted 4 years 6 months ago
    • Eoin's Avatar
    • Eoin
    • Hero Rocketeer
    • Posts: 413
    • Thanks: 17

    Re: Adding a custom font that shows in the backend

    Posted 4 years 6 months ago
    • Damir's Avatar
    • Damir
    • Preeminent Rocketeer
    • Posts: 22450
    • Thanks: 2679
    • Web Developer

    Re: Adding a custom font that shows in the backend

    Posted 4 years 6 months ago
  • Re: Adding a custom font that shows in the backend

    Posted 4 years 6 months ago
    • Yah I'll have to make a point to edit that doc to note that theme.yaml cannot be added to custom/.

      But really, unless you want users to have the ability to pick different fonts, @include font-face in your custom.scss is sufficient. Then you can tie it to a class (as you already did) or variable like so (just add this to your custom.scss file):
      $font-family-din-alte: 'din-alte', Helvetica, Arial, sans-serif !default;
      
      h2 {
       font-family: get-font-family($font-family-din-alte);
      }
    • Last Edit: 4 years 6 months ago by Reggie Simmons.
    • The following users have thanked you: Eoin

    • Kind regards,
      Reggie

      Learn to code for free.
      www.freecodecamp.org
    • Eoin's Avatar
    • Eoin
    • Hero Rocketeer
    • Posts: 413
    • Thanks: 17

    Re: Adding a custom font that shows in the backend

    Posted 4 years 6 months ago
    • You the man, top tip. Thanks. Yes, that should be absolutely fine :)
    • Just a lonely web designer trying to make his way
  • Re: Adding a custom font that shows in the backend

    Posted 4 years 6 months ago
    • Eoin's Avatar
    • Eoin
    • Hero Rocketeer
    • Posts: 413
    • Thanks: 17

    Re: Adding a custom font that shows in the backend

    Posted 4 years 6 months ago
    • @reggi although this works, my concern is that the theme file changes and the font picker work is undone. Because this would potentially change all fonts, I decided to remove the change in the theme YAML and do it the manual way using CSS as you showed.

      I think one major downside of this is that it loads multiple fonts for no reason. Can you think of a way NOT to load the fonts from the picker?

      At the moment my solution is to use "Karla" font for both the heading and the body (just one weight, normal). I choose Karla because it is apparently the lightest (175k) and I choose normal because apparently that is the lightest too. This at least reduces the second font size, but I'd rather remove them altogether if possible.

      Can you think of any smart ideas? I assume on potential solution is to build a plugin to remove those fonts before load. Is there an easier or better solution?
    • Just a lonely web designer trying to make his way

Time to create page: 0.056 seconds